<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2beta1/dlp.proto

namespace Google\Cloud\Dlp\V2beta1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Container structure for the content to inspect.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2beta1.ContentItem</code>
 */
class ContentItem extends \Google\Protobuf\Internal\Message
{
    /**
     * Type of the content, as defined in Content-Type HTTP header.
     * Supported types are: all "text" types, octet streams, PNG images,
     * JPEG images.
     *
     * Generated from protobuf field <code>string type = 1;</code>
     */
    private $type = '';
    protected $data_item;

    public function __construct() {
        \GPBMetadata\Google\Privacy\Dlp\V2Beta1\Dlp::initOnce();
        parent::__construct();
    }

    /**
     * Type of the content, as defined in Content-Type HTTP header.
     * Supported types are: all "text" types, octet streams, PNG images,
     * JPEG images.
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Type of the content, as defined in Content-Type HTTP header.
     * Supported types are: all "text" types, octet streams, PNG images,
     * JPEG images.
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

    /**
     * Content data to inspect or redact.
     *
     * Generated from protobuf field <code>bytes data = 2;</code>
     * @return string
     */
    public function getData()
    {
        return $this->readOneof(2);
    }

    /**
     * Content data to inspect or redact.
     *
     * Generated from protobuf field <code>bytes data = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * String data to inspect or redact.
     *
     * Generated from protobuf field <code>string value = 3;</code>
     * @return string
     */
    public function getValue()
    {
        return $this->readOneof(3);
    }

    /**
     * String data to inspect or redact.
     *
     * Generated from protobuf field <code>string value = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Structured content for inspection.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2beta1.Table table = 4;</code>
     * @return \Google\Cloud\Dlp\V2beta1\Table
     */
    public function getTable()
    {
        return $this->readOneof(4);
    }

    /**
     * Structured content for inspection.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2beta1.Table table = 4;</code>
     * @param \Google\Cloud\Dlp\V2beta1\Table $var
     * @return $this
     */
    public function setTable($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2beta1\Table::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getDataItem()
    {
        return $this->whichOneof("data_item");
    }

}

